package com.enqualcomm.kids.mvp.resetpassword;

import android.content.Context;
import android.content.res.TypedArray;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;

import com.enqualcomm.kids.R;
import com.enqualcomm.kids.activities.GetMessageActivity;
import com.enqualcomm.kids.view.BasePager;

public class ResetPwdStep4Pager extends BasePager implements OnClickListener {
	
	private Button next_step_btn;
	private TextView register_username_tv;
	private TextView register_password_tv;

	public ResetPwdStep4Pager(Context context) {
		super(context);
	}
	
	
	@Override
	public View initView() {
		View root = View.inflate(ct, R.layout.pager_register_step4, null);
		next_step_btn = (Button) root.findViewById(R.id.next_step_btn);
		next_step_btn.setOnClickListener(this);
		
		register_username_tv = (TextView) root.findViewById(R.id.register_username_tv);
		register_password_tv = (TextView) root.findViewById(R.id.register_password_tv);

		TextView success_title_tv = (TextView) root.findViewById(R.id.success_title_tv);
		success_title_tv.setText(ct.getString(R.string.sblw_reset_pwd_success));

		return root;
	}

	@Override
	public void onClick(View v) {
		switch (v.getId()) {
		case R.id.next_step_btn:
			((GetMessageActivity)ct).nextPage(4,next_step_btn.getText().toString());
			break;

		default:
			break;
		}
	}
	
	public void setData(String btnName,String username,String password){
		TypedArray typedArray = ct.obtainStyledAttributes(new int[]{R.attr.bg_complete_btn_big});
		next_step_btn.setBackgroundDrawable(typedArray.getDrawable(0));

		register_username_tv.setText(ct.getString(R.string.your_account)+username);
		register_password_tv.setText(ct.getString(R.string.sblw_new_pwd)+" : "+password);
	}
	
}
